home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ham Radio
/
Ham Radio CD-ROM (Emerald Software) (1995).ISO
/
tech
/
minimuf
/
minimuf.bas
Wrap
BASIC Source File
|
1986-08-12
|
5KB
|
153 lines
10 REM MINIMUF 1.1
11 REM From Dec. 82 QST p.36
12 REM Coverted and modified for the IBM-PC by Dennis Allen WA5LXS
13 REM
100 DEF FNACS(X)=-ATN(X/SQR(-X*X+1))+1.5708
110 PI=3.141593
120 DATA 31,28,31,30,31,30,31,31,30,31,31,31
140 M$="JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"
150 R0=PI/180
155 P1=2*PI
160 R1=180/PI
170 P0=PI/2
180 CLS
190 INPUT"Transmitter Latitude, Longitude:";L1,W1
200 IF L1<-90 OR L1>90 THEN BEEP:PRINT"Invalid Latitude, must be between -90 and +90":GOTO 190
210 IF W1<-360 OR W1>360 THEN BEEP:PRINT"Invalid Longitude, must be between -360 and +360":GOTO 190
220 PRINT :INPUT"Receiver Latitude, Longitude:";L2,W2
230 IF L2<-90 OR L2>90 THEN BEEP:PRINT"Invalid Latitude, must be between -90 and +90":GOTO 220
240 IF W2<-360 OR W2>360 THEN BEEP:PRINT"Invalid Longitude, must be between -360 and +360":GOTO 220
250 PRINT :INPUT"Date (Day, Month):";D6,M0
260 IF M0<1 OR M0>12 THEN BEEP:PRINT"Invalid Month (1 - 12)":RESTORE:GOTO 250
270 FOR I=1 TO M0:READ M:NEXT I
280 IF D6<1 OR D6>M THEN BEEP:PRINT"Invalid Day (1 -";M;")":RESTORE:GOTO 250
285 GOTO 2000
290 PRINT :INPUT"Sunspot number";S9
300 IF S9<0 THEN BEEP:PRINT"Sunspot must be positve":GOTO 290
310 A$=MID$(M$,3*M0-2,3)
320 LPRINT "Date: "A$,D6
330 LPRINT "Transmitter location:"
340 LPRINT " Latitude "L1,"Longitude "W1
350 LPRINT "Receiver location:"
360 LPRINT " Latitude "L2,"Longitude "W2
370 LPRINT USING"Sunspot number = ###.#";S9
380 LPRINT:LPRINT " HOUR MUF(Mhz)"
390 LPRINT
400 L1=L1*R0
410 W1=W1*R0
420 L2=L2*R0
430 W2=W2*R0
440 FOR T5=0 TO 23
450 GOSUB 1000
460 LPRINT USING " ## ##.#";T5,J9
470 NEXT T5
480 LPRINT CHR$(12) 'top of form
490 INPUT"Run again Y/N";A$
500 IF A$="Y" OR A$="y" THEN RESTORE:GOTO 180
510 END
1000 REM MINIMUF 3.5
1010 K7=SIN(L1)*SIN(L2)+COS(L1)*COS(L2)*COS(W2-W1)
1020 IF K7=>-1 THEN 1050
1030 K7=-1
1040 GOTO 1070
1050 IF K7<=1 THEN 1070
1060 K7=1
1070 G1=FNACS(K7)
1080 K6=1.59*G1
1090 IF K6>=1 THEN 1110
1100 K6=1
1110 K5=1/K6
1120 J9=100
1130 FOR K1=1/(2*K6) TO 1-1/(2*K6) STEP .9999-1/K6
1140 IF K5=1 THEN 1160
1150 K5=.5
1160 P=SIN(L2)
1170 Q=COS(L2)
1180 A=(SIN(L1)-P*COS(G1))/(Q*SIN(G1))
1190 B=G1*K1
1200 C=P*COS(B)+Q*SIN(B)*A
1210 D=(COS(B)-C*P)/(Q*SQR(1-C^2))
1220 IF D=>-1 THEN 1250
1230 D=-1
1240 GOTO 1270
1250 IF D<=1 THEN 1270
1260 D=1
1270 D=FNACS(D)
1280 W0=W2+SGN(SIN(W1-W2))*D
1290 IF W0=>0 THEN 1310
1300 W0=W0+P1
1310 IF W0<P1 THEN 1330
1320 W0=W0-P1
1330 IF C=>-1 THEN 1360
1340 C=-1
1350 GOTO 1380
1360 IF C<=1 THEN 1380
1370 C=1
1380 L0=P0-FNACS(C)
1390 Y1=.0172*(10+(M0-1)*30.4+D6)
1400 Y2=.409*COS(Y1)
1410 K8=3.82*W0+12+.13*(SIN(Y1)+1.2*SIN(2*Y1))
1420 K8=K8-12*(1+SGN(K8-24))*SGN(ABS(K8-24))
1430 IF COS(L0+Y2)>-.26 THEN 1520
1440 K9=0
1450 G0=0
1460 M9=2.5*G1*K5
1470 IF M9<=P0 THEN 1490
1480 M9=P0
1490 M9=SIN(M9)
1500 M9=1+2.5*M9*SQR(M9)
1510 GOTO 1770
1520 K9=(-.26+SIN(Y2)*SIN(L0))/(COS(Y2)*COS(L0)+9.999999E-04)
1530 K9=12-ATN(K9/SQR(ABS(1-K9*K9)))*7.639437
1540 T=K8-K9/2+12*(1-SGN(K8-K9/2))*SGN(ABS(K8-K9/2))
1550 T4=K8+K9/2-12*(1+SGN(K8+K9/2-24))*SGN(ABS(K8+K9/2-24))
1560 C0=ABS(COS(L0+Y2))
1570 T9=9.7*C0^9.6
1580 IF T9>.1 THEN 1600
1590 T9=.1
1600 M9=2.5*G1*K5
1610 IF M9<=P0 THEN 1630
1620 M9=P0
1630 M9=SIN(M9)
1640 M9=1+2.5*M9*SQR(M9)
1650 IF T4<T THEN 1680
1660 IF (T5-T)*(T4-T5)>0 THEN 1690
1670 GOTO 1820
1680 IF (T5-T4)*(T-T5)>0 THEN 1820
1690 T6=T5+12*(1+SGN(T-T5))*SGN(ABS(T-T5))
1700 G9=PI*(T6-T)/K9
1710 G8=PI*T9/K9
1720 U=(T-T6)/T9
1730 G0=C0*(SIN(G9)+G8*(EXP(U)-COS(G9)))/(1+G8*G8)
1740 G7=C0*(G8*(EXP(-K9/T9)+1))*EXP((K9-24)/2)/(1+G8*G8)
1750 IF G0=>G7 THEN 1770
1760 G0=G7
1770 G2=(1+S9/250)*M9*SQR(6+58*SQR(G0))
1780 G2=G2*(1-.1*EXP((K9-24)/3))
1790 G2=G2*(1+(1-SGN(L1)*SGN(L2))*.1)
1800 G2=G2*(1-.1*(1+SGN(ABS(SIN(L0))-COS(L0))))
1810 GOTO 1880
1820 T6=T5+12*(1+SGN(T4-T5))*SGN(ABS(T4-T5))
1830 G8=PI*T9/K9
1840 U=(T4-T6)/2
1850 U1=-K9/T9
1860 G0=C0*(G8*(EXP(U1)+1))*EXP(U)/(1+G8*G8)
1870 GOTO 1770
1880 IF G2>J9 THEN 1900
1890 J9=G2
1900 NEXT K1
1910 RETURN
2000 REM Solar Flux to Sunspot conversion
2010 INPUT"Enter Solar Flux number";SF
2020 IF SF<65 THEN PRINT"Below table value":GOTO 290
2030 IF SF>=65 AND SF<102 THEN SUN=(SF-64.1454545#)/.7624
2040 IF SF>=102 AND SF<146 THEN SUN=(SF-59.181818#)/.8653999
2050 IF SF>=146 AND SF<193 THEN SUN=(SF-51)/.9490001:GOTO 2080
2060 IF SF>=193 AND SF<=245 THEN SUN=(SF-38.272727#)/1.0327
2070 IF SF>245 THEN PRINT "Above table value":GOTO 290
2080 S9=SUN
2090 GOTO 310
D SF<=245 THEN SUN=(SF-38.272727#)/1.0327
2070 IF SF>245 THEN PRINT "Above table value":GOTO 290
2080 S9=SUN
2090 GOTO 310